<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Person {
            say() {
                console.log(this)
            }
        }

        let p1 = new Person()
        p1.say()

        const x = p1.say
        x()

        console.log('---------------------')

        // 局部 use strict
        function test1() {
            'use strict'
            console.log(this)
        }
        function test2() {
            console.log(this)
        }

        test1()
        test2()

    </script>
</body>
</html>